Dynomotion

Group: DynoMotion Message: 4927 From: Fouijar Date: 5/13/2012
Subject: EnableAxisDest, Homing
Hi Tom,

I would like to set my coordinates to a particular position when Homing.
Normally the function to use is: EnableAxisDest(Z,ch2->Position);
This sets the Z to 0, but actually I would like to set the value to 441.79 mm this makes (441.79*2000)=883580 counts.
When the ref is done, I would like to set the Machine coordinates to the above value without moving, then EnableAxisDest(Z,883580) is inappropriate.
In the script commands there's a function to set the actual position to a user defined position: Pos<N>=<M>.

How could I proceed to do it?

Regards,

J.

Initial Conditions:

I can't first move to the real 0 then Zero the axis, it would be too dangerous, since I would like my 0 machine to be the table height ref. This is without taking into account the potential tooling on the table.

The code I use is the following:

int SaveZLimits; //place to save limit switch settings
DisableAxis(Z); // Disable Z axis
SaveZLimits = ch2->LimitSwitchOptions;
ch2->LimitSwitchOptions = 0;

// enable axe and begin servoing where we are

EnableAxis(Z);//Active Z
Zero(Z);

// Home Z up first - jog until it sees the limit

Jog(Z,50000); // jog slowly positive
while (ReadBit(142)) ; // loop until IO bit goes high (! retiré pour essai )
Jog(Z,0); // stop
while (!CheckDone(Z)) ; // loop until motion completes
Delay_sec(0.5); //Observation delay
Jog(Z,-3000); // start moving
while (!ReadBit(142)) ; // wait for switch (input #142) to change
Jog(Z,0); // StopMotion
while (!CheckDone(Z)) ; // loop until motion completes
DisableAxis(Z); // disable the axis
Zero(Z); // Zero the position
EnableAxisDest(Z,ch2->Position); // re-enable the ServoTick
ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
Delay_sec(0.5); //Observation delay
MoveRelAtVel(Z,-2000.0,1000); // move some amount outside the limits
while (!CheckDone(Z)) ; // loop until motion completes
}
}
Group: DynoMotion Message: 4928 From: TK Date: 5/13/2012
Subject: Re: EnableAxisDest, Homing
ch2->Position = 883580;

TK

On May 13, 2012, at 12:23 PM, "Fouijar" <fouijar@...> wrote:

 

Hi Tom,

I would like to set my coordinates to a particular position when Homing.
Normally the function to use is: EnableAxisDest(Z,ch2->Position);
This sets the Z to 0, but actually I would like to set the value to 441.79 mm this makes (441.79*2000)=883580 counts.
When the ref is done, I would like to set the Machine coordinates to the above value without moving, then EnableAxisDest(Z,883580) is inappropriate.
In the script commands there's a function to set the actual position to a user defined position: Pos<N>=<M>.

How could I proceed to do it?

Regards,

J.

Initial Conditions:

I can't first move to the real 0 then Zero the axis, it would be too dangerous, since I would like my 0 machine to be the table height ref. This is without taking into account the potential tooling on the table.

The code I use is the following:

int SaveZLimits; //place to save limit switch settings
DisableAxis(Z); // Disable Z axis
SaveZLimits = ch2->LimitSwitchOptions;
ch2->LimitSwitchOptions = 0;

// enable axe and begin servoing where we are

EnableAxis(Z);//Active Z
Zero(Z);

// Home Z up first - jog until it sees the limit

Jog(Z,50000); // jog slowly positive
while (ReadBit(142)) ; // loop until IO bit goes high (! retiré pour essai )
Jog(Z,0); // stop
while (!CheckDone(Z)) ; // loop until motion completes
Delay_sec(0.5); //Observation delay
Jog(Z,-3000); // start moving
while (!ReadBit(142)) ; // wait for switch (input #142) to change
Jog(Z,0); // StopMotion
while (!CheckDone(Z)) ; // loop until motion completes
DisableAxis(Z); // disable the axis
Zero(Z); // Zero the position
EnableAxisDest(Z,ch2->Position); // re-enable the ServoTick
ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
Delay_sec(0.5); //Observation delay
MoveRelAtVel(Z,-2000.0,1000); // move some amount outside the limits
while (!CheckDone(Z)) ; // loop until motion completes
}
}

Group: DynoMotion Message: 4930 From: Fouijar Date: 5/13/2012
Subject: Re: EnableAxisDest, Homing
Thanks,

J.

--- In DynoMotion@yahoogroups.com, TK <tk@...> wrote:
>
> ch2->Position = 883580;
>
> TK
>
> On May 13, 2012, at 12:23 PM, "Fouijar" <fouijar@...> wrote:
>
> > Hi Tom,
> >
> > I would like to set my coordinates to a particular position when Homing.
> > Normally the function to use is: EnableAxisDest(Z,ch2->Position);
> > This sets the Z to 0, but actually I would like to set the value to 441.79 mm this makes (441.79*2000)=883580 counts.
> > When the ref is done, I would like to set the Machine coordinates to the above value without moving, then EnableAxisDest(Z,883580) is inappropriate.
> > In the script commands there's a function to set the actual position to a user defined position: Pos<N>=<M>.
> >
> > How could I proceed to do it?
> >
> > Regards,
> >
> > J.
> >
> > Initial Conditions:
> >
> > I can't first move to the real 0 then Zero the axis, it would be too dangerous, since I would like my 0 machine to be the table height ref. This is without taking into account the potential tooling on the table.
> >
> > The code I use is the following:
> >
> > int SaveZLimits; //place to save limit switch settings
> > DisableAxis(Z); // Disable Z axis
> > SaveZLimits = ch2->LimitSwitchOptions;
> > ch2->LimitSwitchOptions = 0;
> >
> > // enable axe and begin servoing where we are
> >
> > EnableAxis(Z);//Active Z
> > Zero(Z);
> >
> > // Home Z up first - jog until it sees the limit
> >
> > Jog(Z,50000); // jog slowly positive
> > while (ReadBit(142)) ; // loop until IO bit goes high (! retiré pour essai )
> > Jog(Z,0); // stop
> > while (!CheckDone(Z)) ; // loop until motion completes
> > Delay_sec(0.5); //Observation delay
> > Jog(Z,-3000); // start moving
> > while (!ReadBit(142)) ; // wait for switch (input #142) to change
> > Jog(Z,0); // StopMotion
> > while (!CheckDone(Z)) ; // loop until motion completes
> > DisableAxis(Z); // disable the axis
> > Zero(Z); // Zero the position
> > EnableAxisDest(Z,ch2->Position); // re-enable the ServoTick
> > ch2->LimitSwitchOptions = SaveZLimits; // restore limit settings
> > Delay_sec(0.5); //Observation delay
> > MoveRelAtVel(Z,-2000.0,1000); // move some amount outside the limits
> > while (!CheckDone(Z)) ; // loop until motion completes
> > }
> > }
> >
> >
>